Table Of Contents

Previous topic

CoulombSummation class

Next topic

BondOrderParameters class

This Page

Coordinator class

Coordinator is short for ‘Coordination Calculator’.

This class provides a utility for calculating and storing bond order factors needed for bond order or Tersoff-like potentials. Here, bond order refers roughly to the number of neighbors of an atom, however, the bond order factors may depend also on the atomic distances, angles and other local geometric factors.

To use a Coordinator, one must pass it first to a Potential object, which is further given to a Pysic calculator. Then, one can use the calculator to calculate forces or just the bond order factors. When a Coordinator is added to a Potential, the potential is multiplied by the bond order factors as defined by the Coordinator.

Bond order potentials

A bond order factor can be added to any Potential object. This means that the potential is multiplied by the bond order factor. The factors are always defined by atom, but for a two and many body potentials the average is applied. To put in other words, if we have, say, a three-body potential

\[V = \sum_{(i,j,k)} v_{ijk},\]

where the sum goes over all atom triplets (i,j,k), adding a bond order factor ‘b’ will modify this to

\[V = \sum_{(i,j,k)} \frac{1}{3}(b_i + b_j + b_k) v_{ijk}.\]

The corresponding modified force (acting on atom alpha) would be

\[F_{\alpha} = -\nabla_{\alpha} V = - \sum_{(i,j,k)} \frac{1}{3}(\nabla_{\alpha} b_i + \nabla_{\alpha} b_j + \nabla_{\alpha} b_k) v_{ijk} + \sum_{(i,j,k)} \frac{1}{3}(b_i + b_j + b_k) f_{\alpha,ijk} .\]

where

\[f_{\alpha,ijk} = -\nabla_{\alpha} v_{ijk}\]

is the gradient of the unmodified potential.

Note that since the bond factor of an atom usually depends on its whole neighborhood, moving a neighbor of an atom may change the bond factors. In other words, the gradients

\[\nabla_{\alpha} b_i + \nabla_{\alpha} b_j + \nabla_{\alpha} b_k\]

can be non-zero for values of alpha other than i, j, k. Thus adding a bond factor to a potential effectively increases the number of bodies in the interaction.

Parameter wrapping

Bond order factors are defined by atomic elements (chemical symbols). Unlike potentials, however, they may incorporate different parameters and cutoffs for different elements and in addition, they may contain parameters separately for single elements, pairs of elements, element triplets etc. Due to this, a bond order factor can contain plenty of parameters.

To ease the handling of all the parameters, a wrapper class BondOrderParameters is defined. A single instance of this class defines the type of bond order factor and contains the cutoffs and parameters for one set of elements. The Coordinator object then collects these parameters in one bundle.

The bond order types and all associated parameters are explained in the documentation of BondOrderParameters.

Bond order mixing

In general, bond order factors are of the form

\[b_i = s_i( \sum_{(i,j,\ldots)} c_{ij\ldots} )\]

where \(c_{ij\ldots}\) are local environment contributors and \(s_i\) is a per-atom scaling function. For example, if one would define a factor

\[b_i = 1 + \sum_{(i,j)} f(r_{ij}),\]

then

\[\begin{split}c_{ij} = f(r_{ij}) \\ s_i(x) = 1 + x.\end{split}\]

When bond order factors are evaluated, the sums \(\sum_{(i,j,\ldots)} b_{ij\ldots}\) are always calculated first and only then the scaling \(s_i\) is applied atom-by-atom.

When a Coordinator contains several BondOrderParameters:

>>> crd = pysic.Coordinator( [ bond1, bond2, bond3 ] )

they are all added together in the bond order sums \(\sum_{(i,j,\ldots)} b_{ij\ldots}\). Mixing different types of bond order factors is possible but not recommenended as the results may be unexpected.

The scaling is always carried out at most only once per atom. This is done as follows. The list of bond order parameters is searched for a parameter set which requires scaling and which contains 1-body parameters for the correct element. (That is, the first atomic symbol of the list of targets of the parameter must equal the element of the atom for which the scaling is done.) Once such parameters are found, they are used for scaling and the rest of the parameters are ignored. In practice this means that the first applicable set of parameters in the list of BondOrderParameters in the Coordinator is used.

Because of this behaviour, the default scaling can be overridden as shown in the following example.

Let’s say we wish to create a potential to bias the coordination number of Cu-O bonds of Cu atoms, \(n\), according to

\[\begin{split}V(n) = \varepsilon \frac{\Delta N}{1 + \exp(\gamma \Delta N)}\\ \Delta N = C (n - N).\end{split}\]

In general, this type of a potential tries to push \(n\) towards \(N\), a given parameter.

We can define this in pysic by overriding the scaling of the coordination bond order factor.:

>>> bond_sum = pysic.BondOrderParameters( 'neighbors', cutoff = 4.0,
...                                       cutoff_margin = 1.0,
...                                       symbols = [['Cu','O']] )
>>> bond_scale = pysic.BondOrderParameters( 'c_scale', symbols = ['Cu'],
...                                         parameters=[epsilon,
...                                         N,
...                                         C,
...                                         gamma] )
>>> crd = pysic.Coordinator( [bond_scale, bond_sum] )
>>> pot = pysic.Potential( 'constant', symbols = ['Cu'],
...                        parameters = [1.0], coordinator = crd )

In the final step, the Coordinator is attached to a Potential with a constant value of 1.0. Since the result is a product between the bond order factor and the potential, the resulting potential is just the bond order factor.

List of methods

Below is a list of methods in Coordinator, grouped according to the type of functionality.

Miscellaneous

Full documentation of the Coordinator class

class pysic.interactions.bondorder.Coordinator(bond_order_parameters=None)[source]

Class for representing a calculator for atomic coordination numbers and bond order factors.

Pysic can utilise ‘Tersoff-like’ potentials which are locally scaled according to bond order factors, related to the number of neighbors of each atom. The coordination calculator keeps track of updating the bond order factors and holds the parameters for calculating the values.

When calculating forces also the derivatives of the coordination numbers are needed. Coordination numbers may be used repeatedly when calculating energies and forces even within one evaluation of the forces and therefore they are stored by the calculator. Derivatives are not stored since storing them could potentially require an N x N matrix, where N is the number of particles.

The calculation of coordination is an operation on the geometry, not the complete physical system including the interactions, and so one can define coordination calculators as standalone objects as well. They always operate on the geometry currently allocated in the core.

Parameters:

bond_order_parameters: list of BondOrderParameters objects
Parameters for calculating bond order factors.
add_bond_order_parameters(params)[source]

Adds the given parameters to this Coordinator.

Parameters:

params: BondOrderParameters
new bond order parameters
calculate_bond_order_factors()[source]

Recalculates the bond order factors for all atoms and stores them.

Similarly to coordination numbers (calculate_coordination()), this method only calculates the factors and stores them but does not return them.

get_bond_order_factors()[source]

Returns an array containing the bond order factors of all atoms.

This method does not calculate the bond order factors but returns the precalculated array.

get_bond_order_gradients(atom_index)[source]

Returns an array containing the gradients of bond order factors of all atoms with respect to moving one atom.

Parameters:

atom_index: integer
the index of the atom the position of which is being differentiated with
get_bond_order_gradients_of_factor(atom_index)[source]

Returns an array containing the gradients of the bond order factor of one atom with respect to moving any atom.

Parameters:

atom_index: integer
the index of the atom the position of which is being differentiated with
get_bond_order_parameters()[source]

Returns the bond order parameters of this Coordinator.

get_group_index()[source]

Returns the group index of the Coordinator.

set_bond_order_parameters(params)[source]

Assigns new bond order parameters to this Coordinator.

Parameters:

params: BondOrderParameters
new bond order parameters
set_group_index(index)[source]

Sets an index for the coordinator object.

In the fortran core, bond order parameters are calculated by bond order parameters. Since a coordinator contains many, they are grouped to a coordinator via a grouping index when the core is initialized. This method is meant to be used for telling the Coordinator of this index. That allows the bond orders can be calculated by calling the Coordinator itself, since the index tells which bond parameters in the core are needed.

Parameters:

index: integer
an index for grouping bond order parameters in the core